package com.example.test.advice.第七章_泛型和反射.建议107_使用反射增加装饰模式的普适性;

public class Client {

    public static void main(String[] args) {
        Animal jerry = new Rat();
        //为jerry添加飞行能力
        jerry = new DecorateAnimal(jerry,FlyFeature.class);
        //为jerry增加钻地能力
        jerry = new DecorateAnimal(jerry,DigFeature.class);
        jerry.doStuff();
    }
}
